using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace OrderingSystem.Core.Entities
{
    [Table("yonghu")]
    public class User
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Column("id")]
        public long id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("addtime")]
        public DateTime addtime { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column("yonghuming")]
        public string yonghuming { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column("mima")]
        public string mima { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Column("xingming")]
        public string xingming { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column("xingbie")]
        public string xingbie { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [Column("touxiang")]
        public string touxiang { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [Column("lianxidianhua")]
        public string lianxidianhua { get; set; }

        /// <summary>
        /// 角色 - 不存在于数据库中，仅用于应用程序逻辑
        /// </summary>
        [NotMapped]
        [JsonIgnore]
        public string Role { get; set; } = "User";

        /// <summary>
        /// 是否删除 - 不存在于数据库中，仅用于应用程序逻辑
        /// </summary>
        [NotMapped]
        [JsonIgnore]
        public bool IsDeleted { get; set; } = false;
    }
} 